package com.spring.controller;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import com.spring.util.*;

import java.util.*;

import com.alibaba.fastjson.*;

/**
 * 首页控制器
 */
@Controller
public class IndexController extends BaseController {

    // 首页
    @RequestMapping(value = {"/", "index"})
    public String Index() {

        List<Map> bhtList = Query.make("lunbotu").order("id desc").limit(5).select();
        assign("bhtList", bhtList);


        List<Map> xuexiziliaolist1 = Query.make("xuexiziliao").limit(8).order("id desc").select();
        assign("xuexiziliaolist1", xuexiziliaolist1);


        List<Map> gonggaolist2 = Query.make("gonggao").limit(4).order("id desc").select();
        assign("gonggaolist2", gonggaolist2);

        if (isAjax()) {
            return json();
        }
        return "index";

    }


}
